package com.neutech.neureg.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.neutech.neureg.po.Patient;
import com.neutech.neureg.service.RegService;

@RestController
@RequestMapping("/his")
public class RegistController {
	@Autowired
	private RegService regService;
	@RequestMapping("/findPatientById")
	public Patient findPatientById(int id){
		return regService.findPatient(id);
	}
	@RequestMapping("/delPatientById")
	public String delPatientById(int id){
		regService.delPatient(id);
		return "delete completed,pls go and check";
	}
	
	@RequestMapping(value="/updatePatientById",method=RequestMethod.POST)
	public String updatePatientById(Patient patient){
		Patient p = new Patient();
		//在Restlet中添加参数测试
		regService.updatePatient(p);
		return "update completed,pls go and check";
	}
	
	@RequestMapping(value="/insertPatient",method=RequestMethod.POST)
	public String insertPatient(Patient patient){
		Patient p = new Patient();
		//在Restlet中进行参数添加测试
		regService.insertPatient(p);
		return "insert completed,pls go and check";
	}
}
